package com.zb.admin.controller;

import com.zb.admin.service.AdUserService;
import com.zb.model.common.Result;
import com.zb.model.dto.admin.AdLoginDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/login")
public class AdLoginController {
    @Autowired
    AdUserService userService;

    @PostMapping("/in")
    public Result login(@RequestBody AdLoginDto dto) {
       Map map = userService.login(dto);
       return Result.SUCCESS(map);
    }
}
